With the development of smart phones and mobile phone software, more and more folders are generated by mobile phones, and also more and more files are stored in mobile phones. Normally, users will clean up junk files and retrieve files and folders in mobile phones. In order to improve the cleanup efficiency of junk files and the retrieval efficiency of folders, etc., it is usually necessary to identify regular expressions corresponding to the names of the files in the electronic device.
A regular expression, also known as formal representation, conventional representation, is a concept in computer science. The regular expression uses a single string to describe, match a series of strings that conform to a certain syntax rule. In practical applications, a user can determine, according to a given regular expression and a string, whether the given string conforms to the filter logic of the regular expression; it is also possible to obtain a user-desired specific part from a given string by a given regular expression.
At present, a regular expression corresponding to the name of a file in an electronic device is mainly identified manually, and the specific process is as follows: manually judging the name of each file in the electronic device, judging whether there is a regular expression template that matches this file name in a preset regular expression template library; if so, manually identifying the regular expression corresponding to the file name based on the matched regular expression template. For example, when the file name whose regular expression needs to be determined is “3548795”, first manually determine a regular expression template that matches the file name in the preset regular expression template library, assuming that the matched regular expression template is [0-9] {s %}, and s % represents the length of the string; and further manually identify the regular expression “[0-9] {7}” corresponding to the file name “3548795”.
However, when there are more files and thus more file names in an electronic device, identifying the file names in the electronic device using the above manual methods takes more time, and the efficiency is low.